from Base import message, intersect, SS_VALID
from DRG import MDCR_DRG

def group(record):
  adrg_zd = ["Z51.000x013","Z51.100x004","Z51.800x953","Z51.800x983"]
  adrg_zd1 = []
  adrg_ss = ["99.2500x036","99.2500x037","99.2502","99.2503","99.2504","99.2505","99.2506","99.2800x003","99.2800x004","99.2800x005","99.2800x006","99.2801"]
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and record.ssList and record.ssList[0] in adrg_ss:
    message('符合RP1入组条件，匹配规则：主诊断匹配、主手术匹配')

    if MDCR_DRG.RP11_group(record):
      return 'RP11'

    if MDCR_DRG.RP15_group(record):
      return 'RP15'
        
    return 'RP1'
  else:
    return ''
    
